private ["_handler","_results","_idx","_array","_index","_params","_fnc","_debug","_result"];
_debug = false;
_handler = toupper(_this select 0);
_params = [];
if (count _this > 1) then { _params = _this select 1 };
_index = -1;
if (count _this > 2) then { _index = _this select 2 };
_results = [];

_handlers_list = TYR_FUNCTIONS_HANDLER_LIST select 0;
_functions_list = TYR_FUNCTIONS_HANDLER_LIST select 1;

if (_debug) then { diag_log Format["TYR.%1 - FunctionContainer - ExecHandler - %2",time,_this] };

_idx = _handlers_list find _handler;
if (_idx >= 0) then {
	if (_idx < count _functions_list) then {
		_array = _functions_list select _idx;
		if (typename _array == typename []) then {
			if (count _array > 0) then {
				if (_index >= 0) then {
					if (_index >= count _array) then { _index = ((count _array) - 1) };
					if (_debug) then { diag_log Format["TYR.%1 - FunctionContainer - ExecHandler - %2",time,["one",_index,(count _array)]] };
					_fnc = _array select _index;
					_result = [];
					if (typename _fnc == typename "") then {
						_result = call compile preprocessfilelinenumbers format[_fnc,_params];
					} else {
						_result = _params call _fnc;
					};
					if (isnil "_result") then { _result = [] };
					_results set [count _results, _result];
				} else {
					if (_debug) then { diag_log Format["TYR.%1 - FunctionContainer - ExecHandler - %2",time,["all",_index,(count _array)]] };
					{
						_fnc = _x;
						_result = [];
						if (typename _fnc == typename "") then {
							_result = call compile preprocessfilelinenumbers format[_fnc,_params];
						} else {
							_result = _params call _fnc;
						};
						if (isnil "_result") then { _result = [] };
						_results set [count _results, _result];
					} foreach _array;
				};
			};
		};
	};
};
if (_debug) then { diag_log Format["TYR.%1 - FunctionContainer - ExecHandler - %2",time,["count",count _results]] };
_results;